#ifndef USERVIEWERFRAME_H
#define USERVIEWERFRAME_H

#include "ui_UserViewerFrame.h"
#include "data/MiniblogUser.h"
#include <QPropertyAnimation>
class QNetworkReply;
namespace Sina
{
	class SinaContext;
	class UserViewerFrame : public QFrame
	{
		Q_OBJECT
		public:
			explicit UserViewerFrame( QWidget* parent = 0 );

			void setContext(SinaContext* c) { m_context = c; }
			void showUserDetail(const MiniblogUser&);
			bool eventFilter(QObject *, QEvent *);
		private:
			Ui::UserViewerFrame ui;
			bool b_isViewing;
			bool b_isClosing;
			MiniblogUser m_viewingUser;
			SinaContext*	m_context;

			QPropertyAnimation m_animation;

			QNetworkReply* r_checkRelationshipReply;

			void updateRelationship();
		private slots:
			void checkRelationshipFinished();
			void animationFinished();
			void closeFrame();

			void gotoWeb();
	};
} // namespace Sina
#endif // USERVIEWERFRAME_H
